package api

import (
	"net/http"

	"gitee.com/Yu-eng/Myproject/my-go-blog/common"
)

func (*Api) SaveAndUpdatePost(w http.ResponseWriter, r *http.Request) {
	//POST请求 操作代表Sava操作
	method := r.Method

	switch method {
	case http.MethodPost:
		//对应文章发布的操作
		params := common.GetRequestJsonParam(r)
		cId := params["categoryId"].(string) //前端返回的数据是string
		content := params["content"].(string)
		markDown := params["markdown"].(string)
		slug := params["slug"].(string)
		title := params["title"].(string)
	case http.MethodPut:
		//对应update操作
	}

}
